// state
const state = {
  // 菜单列表
  menuList: [],
  // 菜单是否折叠
  isCollapsed: false,
  // 专家菜单
  expertMenu: [
    {
      title: '首页',
      path: '/expert',
      icon: 'mdi-home'
    }
  ],
  // 投标人菜单
  bidderMenu: [
    {
      title: '首页',
      path: '/bidder',
      icon: 'mdi-home'
    }
  ],
  // 管理员菜单
  adminMenu: [
    {
      title: '统计报表',
      path: '/admin/dashboard',
      icon: 'mdi-chart-line'
    },
    {
      title: '询标报表',
      path: '/admin/inquiries',
      icon: 'mdi-file-document'
    }
  ]
}

// getters
const getters = {
  getExpertMenu: (state) => state.expertMenu,
  getBidderMenu: (state) => state.bidderMenu,
  getAdminMenu: (state) => state.adminMenu
}

// mutations
const mutations = {
  SET_MENU_LIST(state, menu) { state.menuList = menu },
  TOGGLE_COLLAPSE(state) { state.isCollapsed = !state.isCollapsed }
}

// actions
const actions = {
  setMenuList({ commit }, menu) { commit('SET_MENU_LIST', menu) },
  toggleCollapse({ commit }) { commit('TOGGLE_COLLAPSE') }
}

export default { namespaced: true, state, getters, mutations, actions }
